// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗  
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝  
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// -----------------------------------------------
//  
// This file is automatically generated 
// Please do not edit these files manually
// Run the following in the root of the repos:
//
// 		*NIX 		:	./build.sh codegen
// 		Windows 	:	build.bat codegen
//
// -----------------------------------------------
// ReSharper disable RedundantUsingDirective
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Elasticsearch.Net;
using Elastic.Transport;
using static Elastic.Transport.HttpMethod;

// ReSharper disable InterpolatedStringExpressionIsNotIFormattable
// ReSharper disable once CheckNamespace
// ReSharper disable InterpolatedStringExpressionIsNotIFormattable
// ReSharper disable RedundantExtendsListEntry
namespace Elasticsearch.Net.Specification.ShutdownApi
{
	///<summary>
	/// Shutdown APIs.
	/// <para>Not intended to be instantiated directly. Use the <see cref = "IElasticLowLevelClient.Shutdown"/> property
	/// on <see cref = "IElasticLowLevelClient"/>.
	///</para>
	///</summary>
	public class LowLevelShutdownNamespace : NamespacedClientProxy
	{
		internal LowLevelShutdownNamespace(ElasticLowLevelClient client): base(client)
		{
		}

		///<summary>DELETE on /_nodes/{node_id}/shutdown <para>https://www.elastic.co/guide/en/elasticsearch/reference/current</para></summary>
		///<param name = "nodeId">The node id of node to be removed from the shutdown state</param>
		///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
		public TResponse DeleteNode<TResponse>(string nodeId, DeleteNodeRequestParameters requestParameters = null)
			where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(DELETE, Url($"_nodes/{nodeId:nodeId}/shutdown"), null, RequestParams(requestParameters));
		///<summary>DELETE on /_nodes/{node_id}/shutdown <para>https://www.elastic.co/guide/en/elasticsearch/reference/current</para></summary>
		///<param name = "nodeId">The node id of node to be removed from the shutdown state</param>
		///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
		[MapsApi("shutdown.delete_node", "node_id")]
		public Task<TResponse> DeleteNodeAsync<TResponse>(string nodeId, DeleteNodeRequestParameters requestParameters = null, CancellationToken ctx = default)
			where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(DELETE, Url($"_nodes/{nodeId:nodeId}/shutdown"), ctx, null, RequestParams(requestParameters));
		///<summary>GET on /_nodes/shutdown <para>https://www.elastic.co/guide/en/elasticsearch/reference/current</para></summary>
		///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
		public TResponse GetNode<TResponse>(GetNodeRequestParameters requestParameters = null)
			where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(GET, "_nodes/shutdown", null, RequestParams(requestParameters));
		///<summary>GET on /_nodes/shutdown <para>https://www.elastic.co/guide/en/elasticsearch/reference/current</para></summary>
		///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
		[MapsApi("shutdown.get_node", "")]
		public Task<TResponse> GetNodeAsync<TResponse>(GetNodeRequestParameters requestParameters = null, CancellationToken ctx = default)
			where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(GET, "_nodes/shutdown", ctx, null, RequestParams(requestParameters));
		///<summary>GET on /_nodes/{node_id}/shutdown <para>https://www.elastic.co/guide/en/elasticsearch/reference/current</para></summary>
		///<param name = "nodeId">Which node for which to retrieve the shutdown status</param>
		///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
		public TResponse GetNode<TResponse>(string nodeId, GetNodeRequestParameters requestParameters = null)
			where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(GET, Url($"_nodes/{nodeId:nodeId}/shutdown"), null, RequestParams(requestParameters));
		///<summary>GET on /_nodes/{node_id}/shutdown <para>https://www.elastic.co/guide/en/elasticsearch/reference/current</para></summary>
		///<param name = "nodeId">Which node for which to retrieve the shutdown status</param>
		///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
		[MapsApi("shutdown.get_node", "node_id")]
		public Task<TResponse> GetNodeAsync<TResponse>(string nodeId, GetNodeRequestParameters requestParameters = null, CancellationToken ctx = default)
			where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_nodes/{nodeId:nodeId}/shutdown"), ctx, null, RequestParams(requestParameters));
		///<summary>PUT on /_nodes/{node_id}/shutdown <para>https://www.elastic.co/guide/en/elasticsearch/reference/current</para></summary>
		///<param name = "nodeId">The node id of node to be shut down</param>
		///<param name = "body">The shutdown type definition to register</param>
		///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
		public TResponse PutNode<TResponse>(string nodeId, PostData body, PutNodeRequestParameters requestParameters = null)
			where TResponse : class, ITransportResponse, new() => DoRequest<TResponse>(PUT, Url($"_nodes/{nodeId:nodeId}/shutdown"), body, RequestParams(requestParameters));
		///<summary>PUT on /_nodes/{node_id}/shutdown <para>https://www.elastic.co/guide/en/elasticsearch/reference/current</para></summary>
		///<param name = "nodeId">The node id of node to be shut down</param>
		///<param name = "body">The shutdown type definition to register</param>
		///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
		[MapsApi("shutdown.put_node", "node_id, body")]
		public Task<TResponse> PutNodeAsync<TResponse>(string nodeId, PostData body, PutNodeRequestParameters requestParameters = null, CancellationToken ctx = default)
			where TResponse : class, ITransportResponse, new() => DoRequestAsync<TResponse>(PUT, Url($"_nodes/{nodeId:nodeId}/shutdown"), ctx, body, RequestParams(requestParameters));
	}
}